import Frame from "@/views/main/Frame.vue"
import Home from "@/views/Home/Home.vue"
import MyAbsent from "@/views/absent/MyAbsent.vue"
import SubAbsent from "@/views/absent/SubAbsent.vue"
import PublishInform from "@/views/inform/PublishInform.vue"
import Informlist from "@/views/inform/Informlist.vue"
import InformDetail from "@/views/inform/InformDetail.vue"
import AddStaff from "@/views/staff/AddStaff.vue"
import StaffList from "@/views/staff/StaffList.vue"
import Absent from "@/views/absent/Index.vue"
import Inform from "@/views/inform/Index.vue"
import Staff from "@/views/staff/Index.vue"
import { PermissionChoices } from "@/stores/auth"

const routes = [
    {
      path: '/',
      name: 'frame',
      component: Frame,
      children: [
        {
            path: "/", name: "home", component: Home,
            meta: {
                icon: "HomeFilled",
                text: "首页",
                permissions: [PermissionChoices.Staff],
                opt: "|"
            },
        },
        {
            path: "/absent", name: "absent", component: Absent,
            meta: {
                icon: "Checked",
                text: "考勤管理",
                permissions: [PermissionChoices.Staff],
                opt: "|"
            },
            children: [
                {
                    path: 'my', name:'myabsent', component: MyAbsent,
                    meta: {
                        icon: "UserFilled",
                        text: "个人考勤",
                        permissions: [PermissionChoices.Staff],
                        opt: "|"
                    }
                },
                {
                    path: 'sub', name:'subabsent', component: SubAbsent,
                    meta: {
                        icon: "User",
                        text: "下属考勤",
                        permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                        opt: "|"
                    }
                },
            ]
        },
        {
            path: "/inform", name: "inform", component: Inform,
            meta: {
                icon: "BellFilled",
                text: "通知管理",
                permissions: [PermissionChoices.Staff],
                opt: "|"
            },
            children: [
                {
                    path: 'publish', name: 'publishinform', component: PublishInform,
                    meta: {
                        icon: "CirclePlusFilled",
                        text: "发布通知",
                        permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                        opt: "|"
                    }
                },
                {
                    path: 'list', name: 'informlist', component: Informlist,
                    meta: {
                        icon: "List",
                        text: "通知列表",
                        permissions: [PermissionChoices.Staff],
                        opt: "|"
                    }
                },
                {
                    path: 'detail/:pk', name: 'informdetail', component: InformDetail,
                    meta: {
                        hidden: true,
                        permissions: [PermissionChoices.Staff],
                        opt: "|"
                    }
                },
            ]
        },
        {
            path: "/staff", name: "staff", component: Staff,
            meta: {
                icon: "Avatar",
                text: "员工管理",
                permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                opt: "|"
            },
            children: [
                {
                    path: 'add', name: 'addstaff', component: AddStaff,
                    meta: {
                        icon: "CirclePlusFilled",
                        text: "新增员工",
                        permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                        opt: "|"
                    }
                },
                {
                    path: 'list', name: 'stafflist', component: StaffList,
                    meta: {
                        icon: "List",
                        text: "员工列表",
                        permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                        opt: "|"
                    }
                },
            ]
        },
      ]
    }
  ]

export default routes;
